from django.contrib import admin
from .models import Question,Choice,QuestionType,Subject
# Register your models here.


class ChoiceInline(admin.StackedInline):
    model = Choice
    extra = 3



class QuestionAdmin(admin.ModelAdmin):
    fieldsets = [
        ('问题类型',{'fields':['question_type']}),
        ('问题',      {'fields':['question_text']}),
        ]
    inlines = [ChoiceInline]
    list_display = ('question_text','pub_date','question_type')

admin.site.register(Question,QuestionAdmin)
admin.site.register(Choice)
admin.site.register(QuestionType)
admin.site.register(Subject)
